<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:87:"C:\phpStudy\PHPTutorial\WWW\P201801\fly\public/../application/index\view\tie\index.html";i:1526263741;s:74:"C:\phpStudy\PHPTutorial\WWW\P201801\fly\application\index\view\layout.html";i:1526020551;s:79:"C:\phpStudy\PHPTutorial\WWW\P201801\fly\application\index\view\public\cate.html";i:1526092429;s:82:"C:\phpStudy\PHPTutorial\WWW\P201801\fly\application\index\view\public\weekHot.html";i:1525759838;}*/ ?>
<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <title><?php echo !empty($title)?$title:" "; ?>-<?php echo config('site.site_name'); ?></title>
        <link rel="stylesheet" href="//at.alicdn.com/t/font_24081_dddajmj0coc4n29.css?id=<?php echo config('site.tt'); ?>">
        <link rel="stylesheet" href="/static/layui/css/layui.css?id=<?php echo config('site.tt'); ?>">
        <link rel="stylesheet" href="/static/index/css/global.css?id=<?php echo config('site.tt'); ?>" charset="utf-8">
        <link rel="stylesheet" href="/static/index/css/main.css?id=<?php echo config('site.tt'); ?>" charset="utf-8">
        <script src="/static/layui/layui.js?id=<?php echo config('site.tt'); ?>"></script>
    </head>
    
    <body>
        <div class="fly-header layui-bg-black">
            <div class="layui-container">
                <a class="fly-logo" href="/">
                    <img src="//res.layui.com/static/images/fly/logo.png?id=<?php echo config('site.tt'); ?>" alt="layui"></a>
                <ul class="layui-nav fly-nav layui-hide-xs">
                    <li class="layui-nav-item">
                        <a href="/">
                            <i class="iconfont icon-jiaoliu"></i>交流9999</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            <i class="iconfont icon-chanpin" style="top: 1px;"></i>专区</a>
                        <dl class="layui-nav-child fly-nav-child">
                            <dd>
                                <a href="/vipclub/list/layuiadmin/">layuiAdmin</a></dd>
                            <hr>
                            <dd>
                                <a href="/vipclub/list/layim/">LayIM</a></dd>
                        </dl>
                        <span class="layui-badge-dot" style="margin: -5px 10px 0; right: 0;"></span>
                    </li>
                    <li class="layui-nav-item">
                        <a href="http://www.layui.com/">
                            <i class="iconfont icon-ui"></i>框架</a>
                    </li>
                </ul>

                <?php if(session('uid')): ?>
                    <ul class="layui-nav fly-nav-user">
                        <li class="layui-nav-item">
                            <a class="fly-nav-avatar" href="/user/" id="LAY_header_avatar">
                                <cite class="layui-hide-xs"><?php echo session('nickname'); ?></cite>
                                <img src="/<?php echo session('face'); ?>">
                                <span class="layui-nav-more"></span>
                            </a>
                            <dl class="layui-nav-child layui-anim layui-anim-upbit">
                                <dd>
                                    <a href="<?php echo url('index/user/index'); ?>">
                                        <i class="layui-icon"></i>用户中心</a></dd>
                                <dd>
                                    <a href="<?php echo url('index/user/set'); ?>">
                                        <i class="layui-icon"></i>基本设置</a></dd>
                                <hr>
                                <dd>
                                    <a href="<?php echo url('index/seting/msg'); ?>">
                                        <i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a>
                                </dd>
                                <dd>
                                    <a href="<?php echo url('index/user/index'); ?>">
                                        <i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>我的主页</a></dd>
                                <hr style="margin: 5px 0;">
                                <dd>
                                    <a href="<?php echo url('index/login/loginout'); ?>" style="text-align: center;">退出</a></dd>
                            </dl>
                        </li>
                    </ul>
                <?php else: ?> 
                    <ul class="layui-nav fly-nav-user">
                        <li class="layui-nav-item">
                            <a class="iconfont icon-touxiang layui-hide-xs" href="/user/login/"></a>
                        </li>
                        <li class="layui-nav-item">
                            <a href="<?php echo url('index/login/index'); ?>">登入</a></li>
                        <li class="layui-nav-item">
                            <a href="<?php echo url('index/reg/index'); ?>">注册</a></li>
                        <li class="layui-nav-item layui-hide-xs">
                            <a href="<?php echo url('index/login/qqlogin'); ?>"  title="QQ登入" class="iconfont icon-qq"></a>
                        </li>
                        <li class="layui-nav-item layui-hide-xs">
                            <a href="/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
                        </li>
                    </ul>
                <?php endif; ?>
            </div>
        </div>
 <div class="layui-hide-xs">
    <div class="fly-panel fly-column">
    <div class="layui-container">
        <ul class="layui-clear">
            <li class="layui-hide-xs  layui-this">
                <a href="/">首页</a></li>
            <?php if(is_array($cates) || $cates instanceof \think\Collection || $cates instanceof \think\Paginator): $i = 0; $__LIST__ = $cates;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cate): $mod = ($i % 2 );++$i;?>
            <li>
                <a href="<?php echo url('index/index/index',['cid'=>$cate['py']]); ?>"><?php echo $cate['cname']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
            <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
                <span class="fly-mid"></span>
            </li>
            <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
                <a href="/user/post/">我发表的贴</a></li>
            <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
                <a href="/user/post/#collection">我收藏的贴</a></li>
        </ul>
        <div class="fly-column-right layui-hide-xs">
            <span class="fly-search LAY_search">
                <i class="layui-icon">&#xe615;</i></span>
            <a href="<?php echo url('index/tie/add'); ?>" class="layui-btn">发表新帖</a></div>
        <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
            <a href="/jie/add/" class="layui-btn">发表新帖</a></div>
    </div>
</div>
</div>
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8 content detail">
            <div class="fly-panel detail-box">
                <h1><?php echo $tie['title']; ?></h1>
                <div class="fly-detail-info">
                    <span class="layui-badge layui-bg-green fly-detail-column"><?php echo $tie['cname']; ?></span>
                    <span class="layui-badge" style="background-color: #999;"><?php echo $tie['status']==0?"未结" : "已结"; ?></span>
                    <div class="fly-admin-box" data-id="26103"></div>
                    <span class="fly-list-nums">
                        <a href="#comment">
                            <i class="iconfont" title="回答">&#xe60c;</i><?php echo $tie['replay']; ?></a>
                        <i class="iconfont" title="人气">&#xe60b;</i><?php echo $tie['view']; ?></span></div>
                <div class="detail-about">
                    <a class="fly-avatar" href="/u/12601008/">
                        <img src="/<?php echo $tie['face']; ?>" alt="Heat"></a>
                    <div class="fly-detail-user">
                        <a href="/u/12601008/" class="fly-link">
                            <cite><?php echo $tie['nickname']; ?></cite></a>
                        <span><?php echo Ftime($tie['ctime']); ?></span></div>
                    <div class="detail-hits" id="LAY_jieAdmin" data-id="26103">
                        <span style="padding-right: 10px; color: #FF7200">悬赏：<?php echo $tie['kiss']; ?>飞吻</span>
                        <span class="layui-btn layui-btn-xs jie-admin <?php echo !empty($tie['coid'])?'layui-btn-danger':''; ?>" type="collect" id="collect" data="<?php echo $tie['qid']; ?>" data-type="add"><?php echo !empty($tie['coid'])?'取消收藏':'收藏'; ?></span>
                    </div>
                </div>
                <div class="detail-body layui-text photos">
                    <?php if($tie['ext']): ?>
                    <table class="layui-table">
                        <tbody>
                            <tr>
                                <td>版本：<?php echo $tie['ext']['project']; ?> <?php echo $tie['ext']['version']; ?></td>
                                <td>浏览器：<?php echo $tie['ext']['browser']; ?></td></tr>
                        </tbody>
                    </table>
                    <?php endif; ?>
                    <?php echo $tie['content']; ?>
                </div>
            </div>
            <div class="fly-panel detail-box" id="flyReply">
                <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
                    <legend>回帖</legend></fieldset>
                
                <?php if(!$replays): ?>
                <ul class="jieda" id="jieda"> <li class="fly-none">消灭零回复</li> </ul>
                <?php endif; ?>

                <ul class="jieda" id="jieda">
                    <?php if(is_array($replays) || $replays instanceof \think\Collection || $replays instanceof \think\Paginator): $i = 0; $__LIST__ = $replays;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$reply): $mod = ($i % 2 );++$i;?>
                    <a name="item-<?php echo $reply['rid']; ?>"></a>
                    <li data-id="105249">
                        
                        <div class="detail-about detail-about-reply">
                            <a class="fly-avatar" href="/u/12601008/">
                                <img src="/<?php echo $reply['face']; ?>" alt="Heat"></a>
                            <div class="fly-detail-user">
                                <a href="/u/12601008/" class="fly-link">
                                    <cite><?php echo $reply['nickname']; ?></cite></a>
                            </div>
                            <div class="detail-hits">
                                <span><?php echo Ftime($reply['ctime']); ?></span></div>
                        </div>
                        <div class="detail-body layui-text jieda-body photos"><?php echo $reply['content']; ?></div>
                        <div class="jieda-reply">
                            <span class="jieda-zan <?php echo !empty($reply['rzid'])?'zanok':''; ?>" data="<?php echo $reply['rid']; ?>" type="zan">
                                <i class="iconfont icon-zan"></i>
                                <em><?php echo $reply['zan_num']; ?></em></span>
                            <span type="reply" class="reply" data="<?php echo $reply['nickname']; ?>">
                                <i class="iconfont icon-svgmoban53"></i>回复</span>
                        </div>
                    </li>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
                <div style="text-align: center"></div>
                <a name="reply"></a>
                <div class="layui-form layui-form-pane">
                    <form action="/jie/reply/" method="post">
                        <div class="layui-form-item layui-form-text">
                            <div class="layui-input-block">
                                <textarea id="content" name="content" required  placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <input type="hidden" name="qid" value="<?php echo $tie['qid']; ?>">
                            <button class="layui-btn" lay-filter="add" lay-submit>提交回复</button></div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <dl class="fly-panel fly-list-one">
    <dt class="fly-panel-title">本周热议</dt>
    <?php if(is_array($hotTie) || $hotTie instanceof \think\Collection || $hotTie instanceof \think\Paginator): $i = 0; $__LIST__ = $hotTie;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tie): $mod = ($i % 2 );++$i;?>
    <dd>
        <a href="<?php echo url('index/tie/index',['qid'=>$tie['qid']]); ?>"><?php echo $tie['title']; ?><a>
        <span>
            <i class="iconfont icon-pinglun1"></i><?php echo $tie['replay']; ?></span>
    </dd>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</dl>
            <div class="fly-panel">
                <div class="fly-panel-title">心级赞助商
                    <span style="padding: 0 3px;">-</span>
                    <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a></div>
                <div class="fly-panel-main">
                    <a href="http://www.ukewo.cn/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #1A7BFA;" time-limit="2018-05-13 0:0:0">优客服 - 开源的智能客服系统 + 呼叫中心</a>
                    <a href="http://www.uileader.com/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #43BAE9; font-size: 14px;" time-limit="2018-10-20 0:0:0">TouchUI Pro - 一套代码开发App、H5和小程序</a>
                    <a href="http://core.fineui.com/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #205B95;" time-limit="2018-07-18 0:0:0">FineUI - 9 年控件库 + ASP.NET Core 2.0</a>
                    <a href="http://www.ideacms.net" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #F25123;" time-limit="2018-05-10 0:0:0">IdeaMall商城+小程序系统，小而美，仅6M</a>
                    <a href="https://nai8.me" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #002845;" time-limit="2018-05-08 0:0:0">阿北的知识分享 - Yii/小程序/ES6原创视频</a>
                    <a href="https://juejin.im/welcome/backend?utm_source=layui&utm_medium=banner&utm_content=fangwen&utm_campaign=q2_website" target="_blank" rel="nofollow" class="fly-zanzhu fly-zanzhu-img" time-limit="2018-05-20 0:0:0">
                        <img src="//cdn.layui.com/upload/2018_4/168_1524128314283_57388.jpg" alt="掘金"></a>
                </div>
            </div>
            <div class="fly-panel">
                <div class="fly-panel-title">官方产品</div>
                <div class="fly-panel-main">
                    <a href="http://www.layui.com/admin/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #20222A;">layuiAdmin - layui 官方后台管理模板</a>
                    <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #009688;">LayIM - layui 即时通讯旗舰之作</a></div>
            </div>
            <div class="fly-panel" style="padding: 20px 0; text-align: center;">
                <img src="//cdn.layui.com/upload/2017_8/168_1501894831075_19619.jpg" style="max-width: 100%;" alt="layui">
                <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p></div>
        </div>
    </div>
</div>
<script>
    //Demo
    layui.use(['form','jquery','layedit'], function(){
      var form = layui.form;
      $ = layui.jquery;
      var layedit = layui.layedit;

        layedit.set({
          uploadImage: {
            url: "<?php echo url('index/tie/upload'); ?>" //接口url
            ,type: 'post' //默认post
          }
        });

      xbscontent = layedit.build('content'); //建立编辑器
      //监听提交
      form.on('submit(add)', function(data){

         
        data.field.content  = layedit.getContent(xbscontent);

        $.ajax({
            url: '<?php echo url('index/replay/add'); ?>',
            type: 'POST',
            dataType: 'json',
            data: data.field,
        })
        .done(function(res) {
           if (res.code==0) {
                layer.msg(res.msg,function(){});
           }else{
                layer.alert(res.msg,function(){
                    location.reload();
                });
           }
        })
        .fail(function() {
            layer.msg('系统异常',function(){});
        })
        
        return false;
      });

      
      $('.reply').click(function () {



            window.location.hash = "#reply";

            nickname  = $(this).attr('data');

            oldData = layedit.getContent(xbscontent);

            nickname = "@" + nickname + '';

            location.href = location.href;

            link = "<a href='<?php echo url('index/user/index'); ?>?nickname="+nickname +">@"+nickname+"</a> ";

            // layedit.setContent(xbscontent,oldData+nickname);



      })

      $('#collect').click(function () {
          qid  = $(this).attr('data');

          $.ajax({
                url: '<?php echo url('index/tie/collect'); ?>',
                type: 'POST',
                dataType: 'json',
                data: {qid:qid},
            })
            .done(function(res) {
               if (res.code==0) {
                    layer.msg(res.msg,function(){});
               }else{
                    if(res.msg=='取消收藏'){
                        $('#collect').removeClass('layui-btn-danger');
                        $('#collect').html('收藏');
                    }else{
                        $('#collect').addClass('layui-btn-danger');
                        $('#collect').html('取消收藏');
                    }
               }
            })
            .fail(function() {
                layer.msg('系统异常',function(){});
            })

      })

      $('.jieda-zan').click(function () {

          rid  = $(this).attr('data');

          that = $(this);

          $.ajax({
                url: '<?php echo url('index/replay/zan'); ?>',
                type: 'POST',
                dataType: 'json',
                data: {rid:rid},
            })
            .done(function(res) {
               if (res.code==0) {
                    layer.msg(res.msg,function(){});
               }else{
                    if(res.msg=='取消点赞'){
                        that.removeClass('zanok');
                        that.find('em').html(that.find('em').html()-1);
                    }else{
                        that.addClass('zanok');
                        that.find('em').html(Number(that.find('em').html())+1);
                    }
               }
            })
            .fail(function() {
                layer.msg('系统异常',function(){});
            })

      })
    });
</script>
        
 <div class="fly-footer">
            <p>
                <a href="http://fly.layui.com/">Fly社区</a>2018 &copy;
                <a href="http://www.layui.com/">layui.com</a></p>
            <p>
                <a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a>
                <a href="/case/2018/" target="_blank">Layui案例</a>
                <a href="http://www.layui.com/template/fly/" target="_blank">获取Fly社区模版</a>
                <a href="http://fly.layui.com/jie/2461/" target="_blank">微信公众号</a></p>
            <p class="fly-union">
                <a href="https://www.upyun.com?from=layui" target="_blank" rel="nofollow" upyun>
                    <img src="//res.layui.com//static/images/other/upyun.png?t=1"></a>
                <span>提供 CDN 赞助</span></p>
        </div>

        <script>
        //注意：导航 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function(){
          var element = layui.element;
          
          //…
        });
        </script>
    </body>

</html>